<template>
  <div>
    <h1>我是.sync父亲</h1>
    <!-- <son-component :money="money" @changeMoney="changeMoney" /> -->
    <!-- $event就是子组件传递过来的值(this.money-10) -->
    <!-- <son-component :money="money" @update:changeMoney="money=$event" /> -->
    <son-component :money.sync="money" />
  </div>
</template>

<script>
import SonComponent from './components/son-component.vue'
export default {
  components: { SonComponent },
  data() {
    return {
      money: 100
    }
  },
  methods: {
    // changeMoney(val) {
    // console.log('儿子传给我的', val)
    //   if (val < 60) {
    //     alert('花太多了，不准再花了')
    //   } else {
    //     this.money = val
    //   }
    // }
  }

}
</script>

<style>

</style>
